<template>
  <div id="app">
    <router-view> </router-view>
    <!-- 
      
     -->
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import { delopenId, delapplyid, delactive } from "./utils/cookie.js";
export default {
  name: "App",
  computed: { ...mapGetters(["active", "http", "menuTab"]) },
  watch: {
    active(val) {
      
      switch (val) {
        case "1":
          this.$router.push("/");
          break;
        case "2":
          window.open(this.http + "/user", "_self");
          break;
        case "3":
          window.open(this.http + "/user", "_self");
          break;
        case "4":
          window.open(this.http + "/user", "_self");
          break;
        case "5":
          this.$router.push("/training");
          break;
        case "6":
          this.$router.push("/regulations");
          break;
        case "11":
          this.$router.push("/healthregulations");
          break;
        case "7":
          this.$router.push("/about");
          break;
        case "8":
          window.open(this.http + "/user", "_self");
          break;
        case "9":
          window.open(this.http + "/user", "_self");
          break;
        case "10":
          this.$router.push("/apply");
          break;
      }
    },
  },
  beforeDestroy() {
    //清除所有的cookie
    delopenId();
    delapplyid();
    delactive();
  },
};
</script>

<style>
html,body{
  overflow-x: hidden;
}
</style>
